#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    
    int num = 0;
    
    int arr[2][3];
    for (int i = 0; i < 2; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            scanf("%d", &arr[i][j]);
            if (arr[i][j] > 0)
            {
                num += arr[i][j];
            }
        }
    }
    printf("%d", num);
    return 0;
}
